package com.ms.demo.entity;

public class Emp {

    private Integer id;

    private String empName;

    private Integer empAge;

    private String gender;

    private String status;

    public Emp() {
        System.out.println("spring-bean的生命周期: 1、bean对象创建（调用无参构造器）");
    }

    public Emp(Integer id, String empName, Integer empAge, String gender, String status) {
        this.id = id;
        this.empName = empName;
        this.empAge = empAge;
        this.gender = gender;
        this.status = status;
    }

    public void sayHello(){
        System.out.println("hello world");
    }

    public void initMethod(){
        System.out.println("spring-bean的生命周期：4、bean对象初始化（需在配置bean时指定初始化方法）");
    }
    public void destroyMethod(){
        System.out.println("spring-bean的生命周期：7、bean对象销毁（需在配置bean时指定销毁方法）");
    }



    @Override
    public String toString() {
        return "Emp{" +
                "id=" + id +
                ", empName='" + empName + '\'' +
                ", empAge=" + empAge +
                ", gender='" + gender + '\'' +
                ", status='" + status + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
        System.out.println("spring-bean的生命周期: 2、给bean对象设置属性");
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Integer getEmpAge() {
        return empAge;
    }

    public void setEmpAge(Integer empAge) {
        this.empAge = empAge;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
